Remove transparency value from system colours where needed
authorJyrki Gadinger <nilsding@nilsding.org>
Fri, 3 Jan 2025 10:14:48 +0000 (11:14 +0100)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Mon, 27 Jan 2025 09:03:39 +0000 (10:03 +0100)
For some reason Windows11 has some transparency in the system colours
which makes reading drawers difficult

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
src/gui/tray/MainWindow.qml
theme/Style/Style.qml

index a16b351ae8f70868020d306607f3fc0873b114aa..cf13b90be918be7fc28e591b1abce1aeca397633 100644 (file)
@@ -143,7 +143,7 @@ ApplicationWindow {
             radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius\r
             border.width: Style.trayWindowBorderWidth\r
             border.color: palette.dark\r
-            color: palette.base\r
+            color: Style.colorWithoutTransparency(palette.base)\r
         }\r
 \r
         property int userIndex: 0\r
@@ -180,7 +180,7 @@ ApplicationWindow {
             radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius\r
             border.width: Style.trayWindowBorderWidth\r
             border.color: palette.dark\r
-            color: palette.base\r
+            color: Style.colorWithoutTransparency(palette.base)\r
         }\r
 \r
         property var folderAccountState: ({})\r
@@ -239,7 +239,7 @@ ApplicationWindow {
         clip: true\r
 \r
         radius: Systray.useNormalWindow ? 0.0 : Style.trayWindowRadius\r
-        color: palette.base\r
+        color: Style.colorWithoutTransparency(palette.base)\r
 \r
         Accessible.role: Accessible.Grouping\r
         Accessible.name: qsTr("Nextcloud desktop main dialog")\r
index 014fa5a07690ff1ff698899eccedc4e902075e62..03c7bf932fcd764b0cea1bbca483a1ab35c3f3af 100644 (file)
@@ -200,4 +200,9 @@ QtObject {
     function variableSize(size) {\r
         return size * (1 + Math.min(pixelSize / 100, 1));\r
     }\r
+\r
+    // some platforms (e.g. Windows 11) have a transparency set on palette colours, this function removes that\r
+    function colorWithoutTransparency(color) {\r
+        return Qt.rgba(color.r, color.g, color.b, 1)\r
+    }\r
 }\r